        <div id="thesidebar">
          <form id="form">
            <div class="box tag_box">
              <div class="boxtitle closed">
                <a href="#" class="">网站</a>
              </div><!-- end .boxtitle -->
              <div style="display: block;" class="boxcontent">
                <!-- Tags get inserted here from ajax-->
                <h6 <?php echo $site_id==0?'class="currentSelectedSite"':""; ?>><a href="<?php echo site_url('admin/goods/0/'.($is_publish?1:0)); ?>">全部网站</a></h6>
                <?php foreach($all_site as $sid => $name){ ?>
                <h6 <?php echo $site_id==$sid?'class="currentSelectedSite"':""; ?>><a href="<?php echo site_url('admin/goods/'.$sid.'/'.($is_publish?1:0)); ?>"><?php echo htmlspecialchars($name); ?></a></h6>
                <?php } ?>
              </div><!-- end .boxcontent -->
            </div><!-- end .box -->
          </form>
        </div><!-- end #thesidebar -->
        <div id="dashboardwrap">
          <div id="dashboard" class="box new">
            <div id="dashboard-top">
              <div class="dtHeader">
                <h2><?php echo 0==$site_id?'全部':(isset($all_site[$site_id])?$all_site[$site_id]:''); ?>团购项目<span>[ 共<?php echo $total_count; ?>个 ]&nbsp;&nbsp;&nbsp;<a href="<?php echo site_url('admin/'.($is_publish?'unpuball':'puball')."/$site_id/".urlencode($keyword)); ?>"><?php echo $is_publish?'下线':'发布'; ?>所有团购信息</a></span></h2>
                <form action="<?php echo site_url('admin/goods/'.$site_id.'/'.($is_publish?1:0)); ?>" method="POST">
	                <div id="dashboard-itemsearch"> 
	                  <input type="submit" class="formbutton buttonblue searchButton" value="搜索" />
	                  <input type="text" class="searchKeyword" value="<?php echo htmlspecialchars($keyword); ?>" maxlength="50" title="" name="keyword"/>
	                </div>
                </form>
                <div class="clear"></div>
              </div>
              <div>
                <ul id="adminsortoptions">
                  <li class="<?php echo $is_publish?'':'on'; ?> sortable sa"><a href="<?php echo site_url('admin/goods/'.$site_id.'/0/'.urlencode($keyword)); ?>">未发布</a></li>
                  <li class="<?php echo $is_publish?'on':''; ?> sortable sa"><a href="<?php echo site_url('admin/goods/'.$site_id.'/1/'.urlencode($keyword)); ?>">已发布</a></li>
                </ul>              
                <div class="clear"></div>
              </div>
            </div><!-- end #dashboard-top -->
            <div id="dashboard-body">
            <?php
            $lev1_cat_arr = array();
            foreach ($cat_info as $lev1_cat){
            	$lev1_cat_arr[$lev1_cat['cat_id']] = $lev1_cat['cat_name'];
            }
            
            foreach ($goods as $good) { ?>
              <div class="deal" dealid='<?php echo $good['id'] ?>'>
                <div class="col1">
                  <a href="<?php echo $good['goods_url']; ?>" target="_blank"><img src="<?php echo $good['img_url']; ?>" alt="<?php echo htmlspecialchars($good['title']); ?>" class="image" width="165"></a>
                </div><!-- end .col1 -->
                <div class="col2">
                  <h2><a href="<?php echo $good['goods_url']; ?>" target="_blank"><?php echo htmlspecialchars($good['title']); ?></a></h2>
                  <span class="location_wrap">
                    <p class="address">
                      城市：<?php echo $all_city_map[$good['city_id']]; ?>
                    </p>
                  </span>
                  <span class="location_wrap">
                  	<?php 
                  		$merchant_addr = $good['merchant_addr'];
                  		if($merchant_addr){
                  	?>
                    <p class="address">
                      地址：<?php echo htmlspecialchars($merchant_addr); ?>
                    </p>
                    <?php } ?>
                  </span>
                  <span class="category_wrap">
                    <p class="category">
                      分类：
                      <select class="adminCategory">
                      	<?php foreach ($lev1_cat_arr as $key => $val){ ?>
                      	<option value="<?php echo $key; ?>" <?php echo $key==$good['cat_level1']?'selected':''; ?>><?php echo $val; ?></option>
                      	<?php } ?>
                      </select>
                    </p>
                  </span>

                  <div class="tags" style="clear:both">
                    <p>
                      <span class="tag_wrap">
                        <label>标签：</label>
                        <select class="adminTag">
                        <?php 
                        	if(isset($cat_info[$good['cat_level1']]) && is_array($cat_info[$good['cat_level1']]['data'])){
                        		foreach ($cat_info[$good['cat_level1']]['data'] as $lev2_cat){ ?>
                      	<option value="<?php echo $lev2_cat['id']; ?>" <?php echo $lev2_cat['id']==$good['cat_level2']?'selected':''; ?>><?php echo $lev2_cat['cat_name']; ?></option>
                      	<?php 
                        		} 
                        	}                      	
                      	?>
                        </select>
                      </span> 
                      <a href="#this" class="addNewTag">添加新标签</a>
                    </p>
                  </div>
                  <div>
                    <a href="<?php echo site_url('admin/delgood/'.$good['id'].'/'.$site_id.'/'.($is_publish?1:0).'/'.$keyword); ?>">删除</a>
                  </div>
                  <div style="clear: both;"></div>
                </div><!-- end .col2 -->
                <div class="col3">
                  <div class="container first">
                    <ul>
                      <li class="discount"><span>￥<?php echo $good['sale_price']; ?></span><a href="<?php echo site_url('admin/'.($is_publish?'unpubgood':'pubgood').'/'.$good['id'].'/'.$site_id.'/'.($is_publish?1:0).'/'.$keyword); ?>" class="formbutton"><?php echo $is_publish?'下线':'发布'; ?></a><div class="clear"></div></li>
                    </ul>
                  </div>
                  <div class="container">
                    <ul class="info">
                      <li><span>原价</span><br>￥<?php echo $good['original_price']; ?></li>
                      <li><span>折扣</span><br><?php echo number_format($good['sale_rate'],1) ; ?>折</li>
                      <li class="last"><span>节省</span><br>￥<?php echo $good['original_price'] - $good['sale_price'] ; ?></li>
                    </ul>
                  </div><!-- end .container-->
                  <div class="container">
                    <ul>
                      <li style="font-size:14px" class="time countdown hasCountdown ttzcountdown" endtime="<?php echo strtotime($good['close_time']).'000'; ?>"></li>
                    </ul>
                  </div><!-- end .container-->
                  <div class="container" style="border-bottom:none">
                    <ul>
                      <li style="font-size:14px"><?php echo $good['sales_num'] ; ?>人购买</li>
                    </ul>
                  </div><!-- end .container-->
                </div><!-- end .col3 -->
                <div class="clear"></div>
              </div><!-- end .deal -->
              <?php } ?>
   
            <?php echo $page_links; ?>              
            </div><!-- end #dashboard -->
          </div>
          <div class="clear"></div>
        </div>
        <div id="newTagDialog" class="fancybox" title="添加新标签" style="display:none">
          <div id="loginbox-body">
            <h4>标签名</h4>
            <p style="padding-bottom:10px"><input type="text" id="newTagName" value="" class="forminput" maxlength="50" autocapitalize="off" name="newTagName"></p>
            
            <h4>所属分类</h4>
            <p style="padding-bottom:10px">
              <select>
                <?php foreach ($lev1_cat_arr as $key => $val){ ?>
                <option value="<?php echo $key; ?>" <?php echo $key==$good['cat_level1']?'selected':''; ?>><?php echo $val; ?></option>
                <?php } ?>
              </select>
            </p>
            <p>
              <input class="formbutton" type="button" value="保存" />
            </p>
          </div>
        </div>